package com.xiashitech.agent.instrumentation.template;

import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter;

/**
 * Instrumenter 工厂
 */
public class TemplateSingletons {

    private TemplateSingletons() {

    }

    private static final String INSTRUMENTATION_NAME = "com.xiashitech.template";

    private static final Instrumenter<TemplateRequestData, Object> INST;

    public static Instrumenter<TemplateRequestData, Object> instrumenter() {
        return INST;
    }

    static {
        //如果有多个插桩，建议创建多个instrumenter实例，通过spanName参数区分，方便分析和调试
        INST = new TemplateProcessor("template.proc1").buildInstrumenter(INSTRUMENTATION_NAME);
    }

}
